package com.zdp.ribbon;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 类描述:  对CourseService服务的Ribbon客户端的配置
 *
 * @author ZhhengDP
 * @since 2021/8/17
 */
@Configuration
public class CourseServiceRibbonConfig {

    //这边配置一下负载均衡策略就好了

    /**
     * 配置随机策略
     * @return
     */
    @Bean
    public IRule ribbonRule(){
        return new RandomRule();
    }
}
